package com.ag.oa.core.service.impl;

import com.ag.oa.core.dao.IWebQRCodeLoginDao;
import com.ag.oa.core.entity.dto.WebQRCodeLoginDTO;
import com.ag.oa.core.service.IWebQRCodeLoginService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class WebQRCodeLoginServiceImpl implements IWebQRCodeLoginService {

    private static final Logger logger = LoggerFactory.getLogger(IWebQRCodeLoginService.class);

    @Autowired
    private IWebQRCodeLoginDao webQRCodeLoginDao;

    @Override
    public Boolean checkQRCode(String loginCode, Long scancodeTime) {

        return webQRCodeLoginDao.getCountByCodeOrTime(loginCode, scancodeTime)>0;
    }

    @Override
    public Boolean updateSuccessAuthorization(WebQRCodeLoginDTO webQRCodeLoginDTO) {

        return webQRCodeLoginDao.updateSuccessAuthorization(webQRCodeLoginDTO)>0;
    }

}
